<template>
  <div>
    <div class="clearfix" style="margin-bottom: 12px">
      <el-button style="float: right" @click.stop="back" type="primary" size="small" plain>返回</el-button>
    </div>
    <el-row>
      <el-col :span="6">
        <span>申请人姓名：</span><span>{{orderInfo.partnerName}}</span>
      </el-col>
      <el-col :span="6">
        <span>申请人手机号码：</span><span>{{orderInfo.partnerMobile}}</span>
      </el-col>
      <el-col :span="6">
        <span>收货人姓名：</span><span>{{orderInfo.receiver}}</span>
      </el-col>
      <el-col :span="6">
        <span>收货人手机号：</span><span>{{orderInfo.receiverMobile}}</span>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="6">
        <span>运费：</span><span>¥{{orderInfo.freight?orderInfo.freight:'0'}}</span>
      </el-col>
      <el-col :span="18">
        <span>收货人详细地址：</span><span>{{orderInfo.address}}</span>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <span>申请原因：</span><span>{{orderInfo.reason}}</span>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <span>物业合同：</span><span>12121212</span>
      </el-col>
    </el-row>
    <el-table :border="true" :data="dataList" style="width: 400px">
      <el-table-column label="充电桩型号" prop="name"></el-table-column>
      <el-table-column label="台数" prop="count"></el-table-column>
    </el-table>
  </div>
</template>

<script>
  export default {
    name: 'pileInfo',
    data () {
      return {
        id: '',
        dataListLoading: false,
        dataList: [],
        orderInfo: {}
      }
    },
    mounted () {
      this.id = this.$route.query.id
      this.getPileInfo(this.id)
    },
    methods: {
      back () {
        this.$router.go(-1)
      },
      getPileInfo (id) {
        this.$http({
          url: this.$http.adornUrl('/v1/apply/charging/get'),
          method: 'get',
          params: this.$http.adornParams({
            id: id
          })
        }).then(({ data }) => {
          console.log(data)
          this.orderInfo = data.data
          this.dataList = data.data.applyChargingDetailList
        })
      }
    }
  }
</script>

<style lang="scss" scoped>
  .el-row{
    margin-bottom: 20px;
  }
  .el-col>span:first-child{
    color: #666666;
  }
</style>
